<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<%@taglib uri="/struts-tags" prefix="s"%>
<%@taglib uri="/struts-dojo-tags" prefix="sx"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>SCA - PESQUISAR TURMA</title>
    </head>
    <body>
        <h1>PESQUISAR TURMA</h1>
        
        <s:form action="turma">
            <s:select name="codCurso" readonly="true" label="Curso" listKey="codCurso" listValue="nome" 
                list="cursos" ></s:select>
            <s:select name="ano" label="Ano" list="anos" ></s:select>
            <s:select name="semestre" label="Semestre" list="semestres" ></s:select>
            <s:textfield name="nomeDisciplina" label="Nome da Disciplina"></s:textfield>
            <s:submit action="pesquisarTurma" value="Pesquisar"></s:submit>
            <br></br>
            <br></br>
            <br></br>
            <table border="">
                <tr>
                    <th>CODIGO</th>
                    <th>DISCIPLINA</th>
                    <th>PROFESSOR</th>
                    <th colspan="3">AÇÕES</th>
                </tr>
                
            <s:iterator value="turmas">
                <tr>
                    <td>${codTurma}</td>
                    <td>${disciplina.nome}</td>
                    <td>${professor.nome}</td>
                    <td>
                        <s:url id="editarTurma" action="editarTurma">
                            <s:param name="codTurma" value="%{codTurma}"></s:param>
                        </s:url>
                        <s:a href="%{editarTurma}">Editar</s:a>
                    </td>
                    <td>
                        <s:url id="excluirTurma" action="excluirTurma">
                            <s:param name="codTurma" value="%{codTurma}"></s:param>
                        </s:url>
                        <s:a href="%{excluirTurma}">Excluir</s:a>
                    </td>
                    <td>
                        <s:url id="editarHorarios" action="editarHorarios">
                            <s:param name="codTurma" value="%{codTurma}"></s:param>
                        </s:url>
                        <s:a href="%{editarHorarios}">Editar Horarios</s:a></td>
                </tr>
            </s:iterator>
                    
            </table>
            
            <s:submit action="voltarTurma" value="Voltar"></s:submit>
            <s:submit action="incluirTurma" value="Incluir"></s:submit>
         
                
        </s:form>
    </body>
</html>